package com.fpt.edu.vn.h2tv.service;

import java.util.List;

import com.fpt.edu.vn.h2tv.dao.TbAccountDAO;
import com.fpt.edu.vn.h2tv.dao.entity.TbAccount;

public class UserBannedChecker {

    public static boolean isBanned(String userName){
        TbAccountDAO dao = new TbAccountDAO();
        List<TbAccount> accounts = dao.findByUsername(userName);
        if(accounts!=null&&accounts.size()>0){
            TbAccount account = accounts.get(0);
            return(account.getIsBanned());
        }
        return false;
    }
}
